package cn.edu.zafu.bigdata.lwg;

public interface Movable {
    void move();

    void stop();
}

 interface Resizable {
    void resize(double factor);
}

class Car implements Movable {
    @Override
    public void move() {
        System.out.println("The car is moving.");
    }

    @Override
    public void stop() {
        System.out.println("The car has stopped.");
    }
}

class ResizableCircle implements Movable, Resizable {
    private double radius;

    public ResizableCircle(double radius) {
        this.radius = radius;
    }

    @Override
    public void move() {
        System.out.println("The circle is moving.");
    }

    @Override
    public void stop() {
        System.out.println("The circle has stopped.");
    }

    @Override
    public void resize(double factor) {
        radius *= factor;
        System.out.println("The circle's radius has been resized to: " + radius);
    }

    public double getRadius() {
        return radius;
    }
}

class TestInterface {
    public static void main(String[] args) {
        Car car = new Car();
        car.move();
        car.stop();

        ResizableCircle circle = new ResizableCircle(5.0);
        circle.move();
        circle.stop();
        circle.resize(2.0);
    }
}